<?php defined('BASEPATH') or exit('No direct script access allowed'); ?>
<?php breadcumb(4, array(language_translate('breadcumb_agent_add_new'),site_url("agent/profile/add_new")));?>

<form action="<?php echo site_url('agent/escort/submit_add_new');?>" name="submit_add_new" id="submit_add_new" method="post" enctype="multipart/form-data" >
	<div class="dashboard-info-wrapper">
		<div class="dashboard-info-left"><span><?php echo language_translate('contact_info_name');?></span></div>
		<div class="dashboard-info-right">
			<div class="select-box">
				<input type="text" name="contact_info_name" id="contact_info_name" value="" maxlength="45" class="text-box3">
			</div>
			<div class="input-error" id="contact_info_name_err" >&nbsp;</div>
			
			<div class="clear"></div>
		</div>
		<div class="clear"></div>
	</div>
	
	<div class="dashboard-info-wrapper">
		<div class="dashboard-info-left"> 
			<div class="select-box">
				<input type="submit" class="save-button" value="Submit" /> 
			</div>
		 </div>
		 <div class="dashboard-info-right">
			<?php echo loader_image("id='contact_info_loader_image' class='hidden'");?>
		</div>
		<div class="clear"></div>
	</div>	

	<div class="dashboard-info-wrapper">
		<div id="update-message"><?php echo language_translate('created_successfully_message');?></div>
		<div class="clear"></div>
	</div>
	
</form>	


<script type="text/javascript">
	$(document).ready(function() {	
		var options = { 
			beforeSubmit:  validateB4Submit,  
			success:       processAfterResponding   
		};	
		$('#submit_add_new').ajaxForm(options); 
		$('ul.ui-tabs-nav').hide(); 
	});	
	function validateB4Submit(formData, jqForm, options){
		$('#contact_info_loader_image').show();
		return true;
	}

	function processAfterResponding(responseText, statusText, xhr, $form) {
		$('#contact_info_loader_image').hide();	
		if(responseText == 'ok'){
			updatedShow();
			window.setTimeout("gotoMyTab()",3000);
		}else{
			debug(responseText);
		}
	}
	
	function gotoMyTab(){
		queryurl(BASE_URI+'agent/my_profile');
	}
	
</script>		